class PartStockinDetail < ActiveRecord::Base
	belongs_to :part_stockin
	belongs_to :part
	belongs_to :part_style

	after_create :cal_sub_total

	def cal_sub_total
  	  update_attributes(sub_total: self.part.purchase_price*self.qty)
	end
end
